package com.enjoy;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class EnjoyServerSocket {
    public static void main(String[] args) throws IOException {

        ServerSocket serverSocket = new ServerSocket(8090);
        Socket socket = serverSocket.accept();
        InputStream inputStream = socket.getInputStream();
        for (; ; ) {
            byte[] bytes = new byte[1024];
            int i = inputStream.read(bytes);
            System.out.println(new String(bytes, 0, i));
        }
    }
}
